package org.cybertech.common.service.config.datasource;

import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

/**
 * @Title: DynamicDataSource.java
 * @Package:com.gethub.config
 * @Description:动态数据源
 * @author: zhengshunzhi
 * @date    2018年2月8日 上午11:05:59
 * @version V1.0
 */
public class DynamicDataSource extends AbstractRoutingDataSource {

    @Override
    protected Object determineCurrentLookupKey() {
    	System.out.println("当前数据源ID:"+DynamicDataSourceContextHolder.getDataSourceType());
        return DynamicDataSourceContextHolder.getDataSourceType();
    }

}
